<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title> [[${pageTitle}]] - [[${T(com.b2c.erp.DataConfigObject).getInstance().getSysName()}]]</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;">
   

    <!-- content starts -->
    <!--    <blockquote class="layui-elem-quote"></blockquote>-->

    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
            <form class="layui-form layui-form-pane1" method="get" action="/funds/order_settlement_detail_pdd">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="orderSn" 
                                   placeholder="订单编号" autocomplete="off" th:value="${orderSn}">
                        </div>
                        <div class="layui-input-inline">
                            <select name="shopId" id="shopId">
                                <option value="">店铺</option>
                                <option  th:each="item: ${shops}" th:text="${item.name}" th:value="${item.id}"></option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="startTime" id="startTime"
                                   placeholder="yyyy-MM-dd" autocomplete="off" th:value="${startTime}">
                        </div>
                        
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="endTime" id="endTime"
                                   placeholder="yyyy-MM-dd" autocomplete="off" th:value="${endTime}">
                        </div>

                    </div>
                    <div class="layui-inline">
                        <button type="submit" class="layui-btn">搜索</button>
                        <i>总共：&nbsp;[[${totalSize}]]&nbsp;条记录</i>
                    </div>
                    <div class="layui-inline"></div>
             
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-primary" th:href="@{/funds/order_settlement_detail_pdd_export(shopId=${shopId},startTime=${startTime},endTime=${endTime})}">导出数据</a>
                    </div>
                </div>
            </form>

        </div>
    </fieldset>

    <!-- start dd-wrapper -->
    <link rel="stylesheet" href="/css/order.css"/>
    <link rel="stylesheet" href="/sb/stock.css"/>
    <div class="dd-wrapper">
        <div class="sp-table">
            <table>
                <thead>
                <tr>
                    <th>订单号</th>
                    <th>下单时间</th>
                    <th>发货时间</th>
                    <th>订单金额</th>
                    <th>订单收入</th>
                    <th>订单支出</th>
                    <th>收益</th>
                    <th>发货状态</th>
                    <th>退款状态</th>
                    <th>订单状态</th>
                    <th>是否结算</th>
                </tr>
                </thead>
                <tbody id="sp-data">

                <tr th:each="item:${lists}">

                    <td><b th:text="${item.orderSn}"></b></td>
                    <td th:text="${item.orderTime}"></td>
                    
                    <td th:text="${item.shippingTime}"></td>
                    <td th:text="${item.payAmount}"></td>
                    <td >
                        <b style="color: rgb(0, 255, 4);" th:text="${item.income}"></b>
                    </td>
                    <td >
                        <b th:text="${item.expend}" style="color:#009789;"></b>
                    </td>
                    
                    <td>
                        <b th:text="${#numbers.formatDecimal(item.income + item.expend,1,2) }"  style="color:#fc0a0a;"></b>
                    </td>
                    <td th:text="${item.sendStatus}"></td>
                    <td th:text="${item.refundStatus}"></td>
                    <td th:text="${item.orderStatus}"></td>
                    <td th:text="${item.settlementStatus}"></td>
                   
                </tr>
                </tbody>
            </table>
            <div class="layui-box layui-laypage layui-laypage-default pageBox">
                <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
            </div>
        </div>



    </div>
    <!-- end dd-wrapper -->


    <script src="/js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        layui.use(['laydate', 'layer','form'], function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#startTime',
                type:'datetime'
            });
            laydate.render({
                elem: '#endTime',
                type:'datetime'
            });
            $("#shopId").val('[[${shopId}]]');
            form.render('select'); //刷新select选择框渲染

        });
        var r = /^\+?[1-9][0-9]*$/;
        $(function () {




        });
    </script>
</div>


</body>
<html>
